﻿using System.Windows;

namespace CoreModule
{
    public class DbColumnConfigurationInfo
    {
        public DbColumnConfigurationInfo() { }

        /// <summary>
        /// 对应的列名
        /// </summary>
        public string ColumnName { get; set; } = string.Empty;
        /// <summary>
        /// 
        /// </summary>
        public DbColumnStatus DbColumnStatus { get; set; } = DbColumnStatus.NotUsed;

        /// <summary>
        /// 字段名
        /// </summary>
        public string FieldName { get; set; } = "---";

        /// <summary>
        /// 配置
        /// </summary>

        public string ConfigurationTitle
        {
           
            get {

                return FieldName.Length > 8 ? FieldName.Substring(0, 8) + "..." : FieldName;
            }
        } 

        /// <summary>
        /// 
        /// </summary>
        public string DetailedTitle
        {
            get
            {

                return FieldName.Length > 8 ? FieldName.Substring(0, 8) + "..." : FieldName;
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public string ResultTitle
        {
            get
            {

                return FieldName.Length > 8 ? FieldName.Substring(0, 8) + "..." : FieldName;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public int SortIndex { get; set; } = -1;

        /// <summary>
        /// 默认选择
        /// </summary>
        public bool IsChecked { get; set; } = false;

        /// <summary>
        /// 
        /// </summary>
        [System.Xml.Serialization.XmlIgnore()]
        public Visibility Visibility
        {
            get
            {
                return IsChecked ? Visibility.Visible : Visibility.Collapsed;
            }
            set
            {

            }
        }
    }
}
